var app = new Vue({
    el: "#main-content",
    data:{
        oldManList: {},
        oldMan: {},
        oldManId: "",
    },
    mounted: function () {
        this.getOldManList();

    },
    methods: {
        getOldManList: function () {
            axios({
                method: 'get',
                url: "nurse/oldmanlist",
                headers: {'token': localStorage.token},
                // headers:{'token': localStorage.token},
            }).then((ins) => {
                console.log(ins);
                let nhDto = ins.data;
                let oldManList = nhDto.data;
                console.log(oldManList);
                if (nhDto.code == 200) {
                    app.oldManList = oldManList;
                    app.oldMan = oldManList[0];
                    app.oldManId = oldManList[0].id;

                    gatcaList(oldManList[0].id);
                    getKinsfolk(oldManList[0].id);
                } else if (nhDto.code == 500) {
                    location.href = "/500.html";
                }
            })
        },
        setOldManId: function (oldManId) {
            app.oldManId = oldManId;
        },
    }
});
